Improve LCMS alignment initialization performance - #770
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR reduces upfront initialization overhead in LCMS-related workflows by deferring construction of annotation processes until identification is actually requested, and by lazily loading MS-FINDER databases only when they’re first needed.
Changes:
- Move LCMS / LC-IM-MS / DIMS annotation process construction inside the
ProcessOption.Identificationexecution path. - Convert MS-FINDER DB fields (product ion, neutral loss, formula, structure, ontology, EI fragment) into lazy-loaded, per-instance cached properties.
- Update MS-FINDER DB consumers to use the lazy-loading properties.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/MSDIAL5/MsdialGuiApp/Model/Setting/InternalMsfinderSettingModel.cs | Lazily loads MS-FINDER databases and routes formula/structure workflows through cached properties to avoid unnecessary startup cost. |
| src/MSDIAL5/MsdialGuiApp/Model/Lcms/LcmsMethodModel.cs | Defers LCMS annotation process creation until identification runs. |
| src/MSDIAL5/MsdialGuiApp/Model/Lcimms/LcimmsMethodModel.cs | Defers LC-IM-MS annotation process creation until identification runs. |
| src/MSDIAL5/MsdialGuiApp/Model/Dims/DimsMethodModel.cs | Defers DIMS annotation process creation until identification runs. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+121
to
124
| var userDefinedDbFilePath = _parameter.UserDefinedDbFilePath; | ||
| if (userDefinedDbFilePath == null || userDefinedDbFilePath == string.Empty) { | ||
| MessageBox.Show("Select your own structure database, or uncheck the user-defined database option.", "Error", MessageBoxButton.OK, MessageBoxImage.Error); | ||
| return; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Reduce unnecessary initialization cost in LCMS-related workflows, especially when identification is not requested and when MS-FINDER databases are not used immediately.
What changed
Notes
The alignment algorithm itself is unchanged. The lazy database loading is scoped to each
InternalMsfinderSettingModelinstance, so loaded databases are released with that model rather than kept in a global cache.